import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/box_buy_response_entity.dart';

BoxBuyResponseEntity $BoxBuyResponseEntityFromJson(Map<String, dynamic> json) {
  final BoxBuyResponseEntity boxBuyResponseEntity = BoxBuyResponseEntity();
  final int? isOpen = jsonConvert.convert<int>(json['is_open']);
  if (isOpen != null) {
    boxBuyResponseEntity.isOpen = isOpen;
  }
  final int? stoneNum = jsonConvert.convert<int>(json['stone_num']);
  if (stoneNum != null) {
    boxBuyResponseEntity.stoneNum = stoneNum;
  }
  return boxBuyResponseEntity;
}

Map<String, dynamic> $BoxBuyResponseEntityToJson(BoxBuyResponseEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['is_open'] = entity.isOpen;
  data['stone_num'] = entity.stoneNum;
  return data;
}

extension BoxBuyResponseEntityExt on BoxBuyResponseEntity {
  BoxBuyResponseEntity copyWith({
    int? isOpen,
    int? stoneNum,
  }) {
    return BoxBuyResponseEntity()
      ..isOpen = isOpen ?? this.isOpen
      ..stoneNum = stoneNum ?? this.stoneNum;
  }
}